package com.deng.Service.impl;

import com.deng.Service.UserDetailService;
import com.deng.mapper.UserDetailMapper;
import com.deng.model.UserDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author 邓小熙
 * @Date 2022/5/24 16:33
 * @Version 1.0
 */
@Service
public class UserDetailServiceImpl implements UserDetailService {
    @Autowired
    UserDetailMapper userDetailMapper;
    /**
     * 通过用户的名字查找用户详情
     * @param userName
     * @return
     */
    @Override
    public UserDetail findUserDetailByUserName(String userName) {
        return userDetailMapper.findUserDetailByUserName(userName);
    }
    /**
     * 通过用户ID增加用户详情
     * @param userDetail
     */
    @Override
    public int insertUserDetailByUserId(UserDetail userDetail) {
        return userDetailMapper.insertUserDetailByUserId(userDetail);
    }
    /**
     * 通过用户ID修改用户详情
     * @param userDetail
     * @return
     */
    @Override
    public int updateUserDetailByUserId(UserDetail userDetail) {
        return userDetailMapper.updateUserDetailByUserId(userDetail);
    }
}
